/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.core.commands.factories;

import com.cea.papyrus.core.commands.DI2UMLMetaclassCreateCommand;
import com.cea.papyrus.core.commands.Di2UMLElementCreateCommand;
import com.cea.papyrus.core.pseudoelement.Metaclass;
import com.cea.papyrus.diagraminterchange2.di2.GraphElement;

/**
 * 
 * 
 * @author Remi SCHNEKENBURGER
 * @author Patrick TESSIER
 */
public class UMLDi2ElementCreateFactory {

	// make private to force singleton use
	/**
	 * 
	 */
	protected UMLDi2ElementCreateFactory() {

	}

	/**
	 * Singleton instance of the factory.
	 */
	public static UMLDi2ElementCreateFactory eINSTANCE = new UMLDi2ElementCreateFactory();





	/**
	 * Creates the command that deletes a package and all its graphical representations.
	 * 
	 * @param element 
	 * @param typeDiagram 
	 * @param parent 
	 * @param elt the element to delete
	 * 
	 * @return the Compoundcommand that deletes the package
	 */
	@SuppressWarnings("unchecked")
	public Di2UMLElementCreateCommand createCommand(Object element, GraphElement parent,String typeDiagram){
//		if(element.equals(Port.class)){
//			return new Di2UMLPortCreateCommand((Class)element,parent,typeDiagram);
//		}
//		else if(element.equals(Actor.class)){
//			return new DI2UMLActorCreateCommand((Class)element,parent,typeDiagram);
//		}
//		else if(element.equals(UseCase.class)){
//			return new DI2UMLUseCaseCreateCommand((Class)element,parent,typeDiagram);
//		}
//		else if(element.equals(Pseudostate.class)){
//			return new DI2UMLPseudostateCreateCommand((Class)element,parent,typeDiagram);
//		}
//		else if(element.equals(FinalState.class)){
//			return new DI2UMLFinalStateCreateCommand((Class)element,parent,typeDiagram);
//		}
//		else if(element.equals(ConnectionPointReference.class)){
//			return new Di2UMLConnectionPointReferenceCreateCommand((Class)element,parent,typeDiagram);
//		}
//		else if ( element.equals(InputPin.class) 
//				|| element.equals(OutputPin.class) ){
//			return new DI2UMLPinCreateCommand((Class)element,parent,typeDiagram);
//		}
		if (element.equals(Metaclass.class)){
			return new DI2UMLMetaclassCreateCommand((Class)element, parent, typeDiagram);
		}
		else{
			return new Di2UMLElementCreateCommand(element,parent,typeDiagram);
		}
	}

}